public class Degrees
{
   /**
      Converts the specified decimal degrees to a string with degrees, minutes, seconds.
      @param decimalDegrees a decimal degree value >= 0, such as 40.25833
      @return a string with the degrees, minutes, and seconds, such as 40°15'30" 
   */
   public String convert(double decimalDegrees)
   {   
      String degSymbol = "\u00B0";
      int d,f,m;
      d=(int)Math.floor(decimalDegrees);
      f=(int)Math.floor((decimalDegrees-d)*60.0);
      m=(int)Math.ceil(((decimalDegrees-d)*60.0-f)*60.0);
      String outPut=String.valueOf(d)+degSymbol+String.valueOf(f)+"'"+String.valueOf(m)+"\"";
      return outPut;
   }
}